//
//  CarTableCell.m
//  19_汽车之家
//
//  Created by dllo on 16/8/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CarTableCell.h"
#import "Car.h"
#import "UIImageView+WebCache.h"

@interface CarTableCell ()
@property (nonatomic, strong) UIImageView *imgView;
@property (nonatomic, strong) UILabel *nameLabel;
@end

@implementation CarTableCell

- (void)setCar:(Car *)car {
    _car = car;
    [_imgView sd_setImageWithURL:[NSURL URLWithString:_car.imgurl]];
    _nameLabel.text = _car.name;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _imgView = [[UIImageView alloc] init];
        [self.contentView addSubview:_imgView];
        _nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _imgView.frame = CGRectMake(8, 8, 63, 37);
    _nameLabel.frame = CGRectMake(74, 8, 312, 37);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
